#!/bin/bash/python
# _*_ coding: utf-8 _*_
# file： remote_config
# date-time: 2023/6/29-10:56
# auth:hard work
# description
import socket


def sw_profile():
    """telnet"""
    ip = "10.11.3.212"
    pwd = "root@123"
    return ip, pwd

def sw_132_profile():
    """telnet"""
    ip = "10.11.3.132"
    pwd = "root@123"
    return ip, pwd

def sw_189_profile():
    """telnet"""
    ip = "10.11.3.189"
    pwd = "root@123"
    return ip, pwd
def ssh_profile():
    """ssh"""
    usrname = "root"
    passwd = "hengshan"
    port = 22
    return usrname, passwd, port


def snmp_v1_v2_profile():
    """v1 & v2 same config"""
    agent_mmsa_ip = "10.11.3.212"
    community = "public"
    udp_port = 161
    return agent_mmsa_ip, community, udp_port


def snmp_v3_config():
    """if not snmp auth,that not need this
    #usmHMACMD5AuthProtocol - MD5 hashing
    #usmDESPrivProtocol - DES encryption
    """
    agent_mmsa_ip = "10.11.0.217"
    udp_port = 161
    userData = (  # SNMP用户信息
        'hxz123456',  # snmp用户名
        'hxz123456',  # 认证密码
        'hxz123456'  # 加密密码
    )
    return agent_mmsa_ip, udp_port, userData


def local_ip():
    """
        查询本机ip地址
        :return: ip
        """
    global s
    try:
        s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        s.connect(('8.8.8.8', 80))
        ip = s.getsockname()[0]
    finally:
        s.close()

    return ip


if __name__ == '__main__':
    print(snmp_v3_config()[2][0])
